﻿using System;

namespace BoldBrick.Core.Logging
{
    /// <summary>
    /// Interface for all logger classes
    /// </summary>
	public interface ILogger
    {
		/// <summary>
		/// Gets true if logging is enabled for specified <see cref="LogLevel"/>, otherwise returns false
		/// </summary>
		/// <param name="level">Level of logging</param>
		/// <returns>Returns true if logging is enabled for specified <see cref="LogLevel"/>, otherwise returns false</returns>
		bool IsEnabled(LogLevel level);

		/// <summary>
		/// Write a record into log
		/// </summary>
		/// <param name="level">Level of the record</param>
		/// <param name="ex">Exception of the record</param>
		/// <param name="message">Message of the record</param>
		/// <param name="pars">Arguments of the message if message contains placeholders</param>
        void Write(LogLevel level, Exception ex, string message, params object[] pars);

		/// <summary>
		/// Write a record into log
		/// </summary>
		/// <param name="level">Level of the record</param>
		/// <param name="message">Message of the record</param>
		/// <param name="pars">Arguments of the message if message contains placeholders</param>
        void Write(LogLevel level, string message, params object[] pars);

		/// <summary>
		/// Write a record into log if logging for specified <see cref="LogLevel"/> is enabled
		/// </summary>
		/// <param name="level">Level of the record</param>
		/// <param name="details">Details of the record</param>
        void LogIfEnabled(LogLevel level, Func<LogDetails> details);
    }
}
